<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>放大镜</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        .box {
            margin: 0 auto;
            width: 75%;
            height: 450px;
            border: 1px solid #ccc;
        }
        
        .img {
            float: left;
            margin-left: 20px;
            margin-top: 20px;
            width: 650px;
            height: 400px;
            border: 1px solid #ccc;
        }
        
        .img img {
            width: 650px;
            height: 400px;
        }
        
        .list {
            float: left;
            margin-left: 20px;
            margin-top: 20px;
            height: 400px;
            width: 200px;
            border: 1px solid #ccc;
        }
        
        .mask {
            display: none;
            width: 50px;
            height: 50px;
            background-color: red;
            opacity: 0.5;
            position: absolute;
        }
        
        .list img {
            height: 80px;
            width: 150px;
        }
        
        .list ul li {
            list-style: none;
            height: 80px;
            width: 150px;
            margin-top: 15px;
            margin-left: 20px;
        }
        /* .list li {
            border: 1px solid #ccc;
        } */
        
        .right {
            float: right;
            height: 400px;
            width: 500px;
            margin-right: 0;
            margin-top: 20px;
        }
        /* .top {
            margin-left: 20px;
            margin-top: 20px;
            width: 450px;
            height: 100px;
        } */
        
        .middle {
            margin-left: 20px;
            margin-top: 20px;
            width: 450px;
            height: 100px;
            background-color: #ccc;
        }
        
        .middle ul li {
            list-style: none;
            margin-top: 10px;
            margin-left: 10px;
        }
        
        .money {
            width: 400px;
            height: 60px;
        }
        
        .font {
            font-size: large;
            color: red;
        }
        
        .end {
            margin-left: 20px;
            margin-top: 40px;
            width: 450px;
            height: 100px;
            background-color: #ccc;
        }
        
        .save {
            background-color: red;
            color: white;
        }
        
        button {
            background-color: #ccc;
            width: 200px;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="left">
            <div class="img">
                <img src="imgs/1.jpg">
            </div>
            <div class="mask"></div>
            <div class="list">
                <!-- <button class="top">▲</button> -->
                <ul>
                    <li><img src="imgs/1.jpg"></li>
                    <li><img src="imgs/2.jpg"></li>
                    <li><img src="imgs/3.jpg"></li>
                    <li><img src="imgs/4.jpg"></li>
                    <li><img src="imgs/5.jpg" style="display: none;"></li>
                    <li><img src="imgs/6.jpg" style="display: none;"></li>
                    <li><img src="imgs/7.jpg" style="display: none;"></li>
                    <li><img src="imgs/8.jpg" style="display: none;"></li>
                </ul>
                <!-- <button class="bottom">▼</button> -->
            </div>
        </div>
    </div>
</body>
<script>
    var lis_img = document.querySelectorAll('.list li img');
    var big = document.querySelector('.img img');
    var top = document.querySelector('.top');
    var bottom = document.querySelector('.bottom');
    var p = 0;
    for (var i = 0; i < lis_img.length; i++) {
        this.lis_img[i].index = i;
        this.lis_img[i].onmousemove = function() {
            big.src = lis_img[this.index].src
        }
    //     top.onclick = function() {
    //         p -= 4;
    //         for (var i = p; i < (p + 4); i++)
    //             lis_img[i].style.display = 'none';
    //         for (var i = (p - 4); i < p; i++)
    //             lis_img[i].style.display = 'block';
    //     }
    //     bottom.onclick = function() {
    //         p += 4;
    //         for (var i = (p - 4); i < p; i++)
    //             lis_img[i].style.display = none;
    //         for (var i = p; i < (p + 4); i++)
    //             lis_img[i].style.display = 'block';
    //     }
    }
</script>

</html>